 <template>
<a-row>
                  <div
                    style="
                      border: 1px solid #dddddd;
                      padding: 20px;
                      background: #fff;
                      margin: 20px;
                    "
                    @click="godetail(book.issueId, book.title)"
                  >
                    <img
                      align="center"
                      :src="book.cover"
                      width="100%"
                      mode="widthFix"
                      style="margin: 0 auto"
                    />
                    <div class="list-group-item-text text-muteds" name="author">
                      <p>{{ book.publish_date }}</p>
                      <p>{{ book.title }}</p>
                    </div>
                    <div class="btn-success">阅读</div>
                  </div>
                </a-row>
</template>

<script>
// import axios from "axios";
// import VueAxios from "vue-axios";
export default {
  props: {
    book: Object,
    id: Number,
    title: String,
    author: String,
    publisher: String,
    publish_date: String,
    pub_year: Number,
    cover: String,
    intro: String,
    isbn: String,
    bisbn: String,
    category: String,
    cates: String,
    booktype: String,
    filetype: String,
    bookid: String,
    assertId: String,
    src: String,
    view_count: Number,
    extid: String,
    ext: String,
    created_at: Number,
    updated_at: Number,
    pc_read: String,
    pc_epub: String,
    wx_read: String,
    wx_epub: String,
    read:String,
    detail: String,
    content:String,
    ebooklist:Array
  },
  data: () => ({
    is_bookinfo_visible: false,
    is_spinning: false,
    header: {},
    body: {},
    info: [],
    headStyles:{
      color:'#2780e3',
      background:'#f5f5f5'
    },
    customStyle:
        'color:#2780e3',
  }),
  watch: {
  },
  computed:{
    getclassname() {
      return this.$store.state.Namedparent.name;
    },
  },
  methods: {
       //   booklist
    godetail(issueId, title) {
      this.$store.commit(
        this.$store.state.Namedparent.name + "/SHOW_DETAIL",
        true
      );
      var paras = {
        issueId: issueId,
        searchtitle: title,
        type: this.$store.state.Namedparent.name,
      };
      this.$store.commit(
        this.$store.state.Namedparent.name + "/ChangeDetailQuery",
        paras
      );
      this.$router.push({
        path: "/QikanrBookDetail",
        query: {
          searchtitle: title,
          issueId: issueId,
          type: this.$store.state.Namedparent.name,
        },
        // params: { id: JSON.stringify(this.$store.rs) },
      });
    },
    // showDrawer() {
    //   this.is_bookinfo_visible = true;
    //   this.$emit("showbookid", true, this.bookid, this.title);
    //   this.$store.commit("BOOKINFO_ALREADY_SHOW", true);
    // },
    // onDrawerClose() {
    //   this.is_bookinfo_visible = false;
    //   this.$emit("showbookid", false);
    //   this.$store.commit("BOOKINFO_ALREADY_SHOW", false);
    // },
    EmitGetBookInfo(marc_no, title) {
      this.$emit("showbookid", false, marc_no, title);
      this.$store.commit("BOOKINFO_ALREADY_SHOW", false);
    },
    // booklist
  },
  mounted() {
    if(this.$route.name == 'detail'){
      this.$store.commit(this.$store.state.Namedparent.name+'/SHOW_DETAIL',true)
    }else{
      this.$store.commit(this.$store.state.Namedparent.name+'/SHOW_DETAIL',false)
    }
    // this.$store.commit(this.$store.state.Namedparent.name+'/SHOW_DETAIL',true)
     
    // console.log(this.muluText)
   // var marc_no = this.$route.params.id;

   // console.log(" %c htis marc_no: ", "color:brown;", marc_no);
    // if (marc_no == this.bookid) {
    // if (!this.is_bookinfo_visible) {
    // this.is_bookinfo_visible = true;
    // this.GetBookInfo(marc_no);
    // this.$emit("ShowBookid", marc_no);
    // }
    // }
  },
};
</script>

<style scoped>
  /deep/.ant-collapse-header{
    color: blueviolet !important;
  }
  .text-muted{
    font-size: 15px;
  }
  .text-muted p{
    border-bottom: 1px dashed #EFEFEF;
    line-height: 2;
  }
  .text-muteds{
    text-align: center;
    margin: 5px auto;
  }
   .text-muteds p{
    margin: 0;
    height: 20px;
    line-height: 20px;
    overflow: hidden;
  }
.btn-success {
    color: #ffffff;
    background-color: #3fb618;
    border-color: #3fb618;
    text-align: center;
    border: 1px solid transparent;
    padding: 10px 10px;
    font-size: 15px;
}
.btn-successread{
    
    display: inline;
    color: #ffffff;
    background-color: #3fb618;
    border-color: #3fb618;
    text-align: center;
    border: 1px solid transparent;
    padding: 10px 10px;
    font-size: 15px;
}
.btn-successread:hover{
  background: #25690f;
}
.bookurl{
  width: 100%;
    display: block;
    height: 50px;
    position: absolute;
    top: 0;
    left: 0;
}
</style>
